home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: realloc(NULL,100)
- Date: 04 Mar 1996 15:56:52 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Mar4085652@qcd.lanl.gov>
- References: <31346CB0.41C67EA6@jupiter.di.uminho.pt> <TANMOY.96Feb28151825@qcd.lanl.gov>
- <1996Mar4.122207.16986@friend.kastle.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: rich@kastle.com's message of Mon, 4 Mar 1996 12:23:15 GMT
-
- In article <1996Mar4.122207.16986@friend.kastle.com>
- rich@kastle.com (Richard Krehbiel) writes:
-
- <snip>
- RK: Something else I wonder; is it valid for realloc(NULL, 100) to fail
- RK: (return NULL) in circumstances that malloc(100) would not? Are the
- RK: mechanics of memory allocation so implementation-defined that it's not
- RK: possible to say? Hm. Probably.
-
- It is possible to say, it is just not possible to ask :-)
- Contrafactuals (`if I had used malloc instead') cannot be tested by a
- strictly conforming C program.
-
- RK: Sheesh. Now I'm fumed. By the standard's grace, none of my programs
- RK: that use malloc may be expected to do a damned thing.
-
- More importantly, there is a `translation limits' section which allows
- the compiler to reject all but one specific program :-)
-
- In any case, it is clear what the standard `intends'. It says very
- clearly that realloc with the first parameter NULL is the same as
- malloc.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-